import java.util.Scanner;

public class DAY2_1 {
    public static void reverse(char[] str,int start,int end){
        while(start<end){
            char tmp=str[start];
            str[start]=str[end];
            str[end]=tmp;
            start++;
            end--;
        }
    }
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String str=scanner.nextLine();
        char[] ch=str.toCharArray();
        int len=ch.length;
        reverse(ch,0,len-1);
        int i=0;
        while(i<len){
            int j=i;
            while(j<len&&ch[j]!=' '){
                j++;
            }if(j<len){
                reverse(ch,i,j-1);
                i=j+1;
            }else{
                reverse(ch,i,j-1);
                i=j;
            }
        }
        String s=new String(ch);
        System.out.println(s);
    }
}
